<!doctype html>
<html>
<head>
    <meta name="Generator"  />
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width">
    <title>选择收货地址</title>
    <meta name="Keywords" content="Call管家" />
    <meta name="Description" content="Call管家" />
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>

    <link rel="stylesheet" href="__HOMECSS__/style.css">
    <script src="__HOMEJS__/jquery-1.7.2.min.js"></script>

</head>

<body style="margin-bottom: 54px;">

<!-- 收货地址 -->
<ul>
    {foreach name='list' item='item'}
        <li class="address_list">
            <a href="javascript:;"  onclick="edit_status({$item.id})" style="display:block;">
                <div class="addresslist_top">
                    <p class="namephone"><span>收货人：{$item.consignee}</span> <span>{$item.mobile}</span></p>
                    <p class="address">收货人：{$item.province}{$item.city}{$item.district}{$item.address}</p>
                </div>
            </a>
        </li>
    {/foreach}

</ul>

<div class="address_new">
    <p>管理地址</p>
</div>
</body>
<script src="__PUBLIC__/layer/layer.js"></script>
<script>
    $(function () {
        $(".address_new").click(function () {
            window.location.href = "{:Url('User/address',['is_cart'=>1])}"
        })
    })

    //设置默认地址
    function edit_status(id){
        $.ajax({
            type:"post",
            url:"{:Url('User/ajax_address_status')}",
            dataType:'json',
            data:{"id":id},
            success:function(result){
                if(result.status==1){
                    window.location.href = "{:Url('Order/cart')}";
                }else{
                    layer.msg(result.info);
                }
            }
        });
    }
</script>

</html>
